package com.digiwin.dap.middleware.auth;

import java.io.Serializable;

/**
 * 登录成功之后对象
 * @author chenxsa
 */
public class AuthoredUser  implements Serializable {
    private long sid;
    private String userId;
    private String userName;
    private long tenantSid;
    private String tenantId;
    private String  tenantName;
    private String token;
    public  AuthoredUser(){
    }


    @Override
    public boolean equals(Object obj) {
        if (obj instanceof AuthoredUser) {
            AuthoredUser test = (AuthoredUser)obj;
            //只要认为用户sid和租户sid相等，就可以认为相等
            if (this.getSid() == test.getSid() && this.getTenantSid() == test.getTenantSid()) {
                return true;
            }
        }

        return false;
    }

    @Override
    public int hashCode() {
        return  (int)(sid ^ tenantSid);
    }

    public long getSid() {
        return sid;
    }

    public void setSid(long sid) {
        this.sid = sid;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public long getTenantSid() {
        return tenantSid;
    }

    public void setTenantSid(long tenantSid) {
        this.tenantSid = tenantSid;
    }

    public String getTenantId() {
        return tenantId;
    }

    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    public String getTenantName() {
        return tenantName;
    }

    public void setTenantName(String tenantName) {
        this.tenantName = tenantName;
    }

}
